package gui;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;

/**
 * 
 * @author Feri
 *
 */
public class Derive {

	private JFrame frame;
	private JTextField textField;
	private JLabel lblResult;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Derive window = new Derive();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public Derive() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setTitle("Derive-it");
		frame.setResizable(false);
		frame.setBounds(100, 100, 450, 200);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);
		
		JLabel lblTheFunction = new JLabel("The function:");
		lblTheFunction.setBounds(60, 80, 99, 20);
		frame.getContentPane().add(lblTheFunction);
		
		textField = new JTextField();
		textField.setBounds(200, 80, 176, 20);
		frame.getContentPane().add(textField);
		textField.setColumns(10);
		
		JButton btnDerive = new JButton("Derive");
		btnDerive.setBounds(60, 122, 89, 23);
		frame.getContentPane().add(btnDerive);
		
		lblResult = new JLabel("The Result");
		lblResult.setBounds(200, 126, 176, 14);
		frame.getContentPane().add(lblResult);
		
		JMenuBar menuBar = new JMenuBar();
		menuBar.setBounds(60, 11, 97, 21);
		frame.getContentPane().add(menuBar);
		
		JMenu mnOptions = new JMenu("Options");
		menuBar.add(mnOptions);
		
		JMenuItem mntmUndo = new JMenuItem("Undo");
		mnOptions.add(mntmUndo);
		
		JMenuItem mntmRedo = new JMenuItem("Redo");
		mnOptions.add(mntmRedo);
		
		String [] functions ;
		
		btnDerive.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				String actualFunction = textField.getText();
				
			}
		});
	}
}
